<template>
	<div class="talent-management">
		<!-- 搜索区域 -->
		<el-form inline :model="searchForm" class="search-form">
			<el-form-item label="名称:">
				<el-input v-model="searchForm.name" placeholder="请输入名称"></el-input>
			</el-form-item>
			<el-form-item label="电话:">
				<el-input v-model="searchForm.phone" placeholder="请输入电话"></el-input>
			</el-form-item>
			<el-form-item label="邮箱:">
				<el-input v-model="searchForm.email" placeholder="请输入邮箱"></el-input>
			</el-form-item>
			<el-form-item label="性别:">
				<el-select v-model="searchForm.gender" placeholder="全部">
					<el-option label="全部" value="all"></el-option>
					<el-option label="男" value="男"></el-option>
					<el-option label="女" value="女"></el-option>
					<el-option label="保密" value="保密"></el-option>
				</el-select>
			</el-form-item>
			<el-form-item>
				<el-button type="primary" @click="handleSearch">搜索</el-button>
				<el-button @click="handleReset">重置</el-button>
			</el-form-item>
		</el-form>

		<!-- 操作按钮 -->
		<div class="action-buttons">
			<el-button type="danger">删除</el-button>
			<el-button type="primary">导出</el-button>
		</div>

		<!-- 表格区域 -->
		<el-table :data="tableData" border style="width: 100%">
			<el-table-column type="selection"></el-table-column>
			<el-table-column prop="activityTitle" label="活动标题" show-overflow-tooltip></el-table-column>
			<el-table-column prop="applicant" label="报名人" show-overflow-tooltip></el-table-column>
			<el-table-column prop="name" label="名称" show-overflow-tooltip></el-table-column>
			<el-table-column prop="phone" label="电话" show-overflow-tooltip></el-table-column>
			<el-table-column prop="email" label="邮箱" show-overflow-tooltip></el-table-column>
			<el-table-column prop="gender" label="性别">
				<template slot-scope="scope">
					<el-select v-model="scope.row.gender" placeholder="请选择">
						<el-option label="男" value="男"></el-option>
						<el-option label="女" value="女"></el-option>
						<el-option label="保密" value="保密"></el-option>
					</el-select>
				</template>
			</el-table-column>
			<el-table-column prop="birthDate" label="出生日期">
				<template slot-scope="scope">
					<el-date-picker v-model="scope.row.birthDate" type="date" value-format="yyyy-MM-dd"
						placeholder="选择日期"></el-date-picker>
				</template>
			</el-table-column>
			<el-table-column prop="nativePlace" label="籍贯" show-overflow-tooltip></el-table-column>
			<el-table-column prop="nationality" label="国籍" show-overflow-tooltip></el-table-column>
			<el-table-column prop="resume" label="简历">
				<template slot-scope="scope">
					<el-button type="text" icon="el-icon-document">
						<el-tooltip effect="dark" content="点击查看简历" placement="top">
							<span>简历</span>
						</el-tooltip>
					</el-button>
				</template>
			</el-table-column>
			<el-table-column prop="auditStatus" label="审核状态">
				<template slot-scope="scope">
					<el-tag v-if="scope.row.auditStatus === '待审核'" type="warning">{{ scope.row.auditStatus }}</el-tag>
					<el-tag v-if="scope.row.auditStatus === '已拒绝'" type="danger">{{ scope.row.auditStatus }}</el-tag>
					<el-tag v-if="scope.row.auditStatus === '已通过'" type="success">{{ scope.row.auditStatus }}</el-tag>
				</template>
			</el-table-column>
			<el-table-column prop="createTime" label="创建时间" width="150" show-overflow-tooltip></el-table-column>
			<el-table-column label="操作">
				<template slot-scope="scope">
					<el-button type="danger" size="mini">删除</el-button>
					<el-button type="primary" size="mini">报名数据</el-button>
					<el-button type="success" size="mini">通过</el-button>
					<el-button type="danger" size="mini">拒绝</el-button>
					<el-button type="primary" size="mini">导出</el-button>
				</template>
			</el-table-column>
		</el-table>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				searchForm: {
					name: '',
					phone: '',
					email: '',
					gender: 'all'
				},
				tableData: [{
					activityTitle: '南京邮电大学2025年全球人才交流会巴塞罗那站',
					applicant: '巴塞罗那站',
					name: '刘中',
					phone: '+34663418960',
					email: 'zliu@icig.es',
					gender: '男',
					birthDate: '1991-11-11',
					nativePlace: '江苏省南通市',
					nationality: '',
					auditStatus: '待审核',
					createTime: '2025-11-07'
				}]
			}
		},
		methods: {
			handleSearch() {
				// 搜索逻辑，可根据searchForm筛选tableData
				console.log('搜索条件：', this.searchForm);
			},
			handleReset() {
				this.searchForm = {
					name: '',
					phone: '',
					email: '',
					gender: 'all'
				};
			}
		}
	}
</script>

<style scoped>
	.talent-management {
		padding: 20px;
	}

	.search-form {
		margin-bottom: 15px;
	}

	.action-buttons {
		margin-bottom: 10px;
	}

	.el-table {
		--el-table-row-hover-bg-color: #f5f7fa;
	}
</style>